#include <stdio.h>

//冒牌排序 

int main(int argc, char const *argv[])
{
    int a[] = {1,-2,3,-5,-4,-7,9,0,3,5,7};
    int n = sizeof(a)/sizeof(a[0]);
    int tmp;
    printf("排序前:");
    for(int i = 0; i < n-1; i++)
    {
        
        for(int j = 0; j < n-1-i; j++)
        {
            if(a[j] > a[j+1]){
                tmp = a[j];
                a[j] = a[j+1];
                a[j+1] = tmp;
            }
        }
    }
    printf("排序后:");
    
    for(int i = 0; i < n; i++)
    {
        /* code */
        printf("%d",a[i]);


    }
    

    return 0;
}
